//transposée d'une matrice carrée 3x3

#include <stdlib.h>
#include <stdio.h>
#define N 3

void transposer(int m[N][N]){
	int i,j;
	int aux;
	for (i=1;i<N;i++){
		for (j=0;j<i;j++){
			aux=m[i][j];
			m[i][j]=m[j][i];
			m[j][i]=aux;
		}
	}
}

void afficherMatrice(int m[N][N]){
	int i,j;
	printf("\n\nLa matrice transposee : ");
	for(i=0;i<N;i++){
		printf("   \n|");
		for(j=0;j<N;j++){
			printf("%d|",m[i][j]);
		}
	}
	printf("\n");
}

int main(){
	int i,j;
	int t[N][N];
	for (i=0;i<N;i++){
		for (j=0;j<N;j++){
			printf("Entrez la valeur de la case se situant sur la ligne %d et la colonne %d : \n",i+1,j+1);
			scanf("%d",&t[i][j]);
		}
	}
	transposer(t);
	afficherMatrice(t);
	return EXIT_SUCCESS;
}
